<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="icon" href="/bitbug_favicon.ico" />
<link href="/Public/Admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/Public/Admin/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->


<title>用户管理</title>
</head>
<body>

<div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a href="javascript:;" onclick="member_add('添加用户','<?php echo U('photoAdd',array('goods_id'=>$_GET['goods_id']));?>','','510')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加图片</a></span> <span class="r">共有数据：<strong id="count"><?php echo ($count); ?></strong> 条</span> </div>
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th width="80">ID</th>
				<th width="100">排序</th>
				<th width="40">大图</th>
				<th width="40">中图</th>
				<th width="90">缩略图</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			<form>
			<?php if(is_array($goods_photo)): $i = 0; $__LIST__ = $goods_photo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr class="text-c">
				<td><input type="checkbox" value="<?php echo ($v['id']); ?>" name=""></td>
				<td><?php echo ($v['id']); ?></td>
				<td><?php echo ($v['sort']); ?></td>
				<td><img style="max-height: 120px;max-width: 120px;" src="<?php echo ($v['big_image']); ?>"/></td>
				<td><img style="max-height: 100px;max-width: 100px;" src="<?php echo ($v['mid_image']); ?>"/></td>
				<td><img style="max-height: 80px;max-width: 80px;" src="<?php echo ($v['thumb_image']); ?>"/></td>
				<td class="td-manage">
				 <a title="编辑" href="javascript:;" onclick="member_edit('编辑','<?php echo U('photoAdd',array('photo_id'=>$v['id'],'goods_id'=>$_GET['goods_id']));?>','4','','510')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> 
				 <a title="删除" href="javascript:;" onclick="member_del(this,'<?php echo U('photoDel',array('photo_id'=>$v['id']));?>')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
			</form>
		</tbody>
	</table>
	</div>
</div>


<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/js/H-ui.js"></script> 
<script type="text/javascript" src="/Public/Admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Admin/js/jquery.form.js"></script>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/Public/Admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">

function datadel(){
	var ids = '';
	var count = 0;
	$('tbody input:checked').each(function(){
		ids += $(this).val()+',';
		count ++;
	});
	
	$.post('<?php echo U("photoDel");?>',{id:ids},function(data){
		if(data.status == 1){
			$('tbody input:checked').each(function(){
				$(this).parents("tr").remove();
			});
			layer.msg('已删除!',{icon:1,time:1000});
			$('#count').text(parseInt($('#count').text())-count);
		}else if(data.status == 2){
			layer.msg(data.msg);
		}else{
			layer.msg(data.msg,{icon:5,time:1000});
		}
	});
}

/*用户-添加*/
function member_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*用户-查看*/
function member_show(title,url,id,w,h){
	layer_show(title,url,w,h);
}

/*用户-编辑*/
function member_edit(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*密码-修改*/
function change_password(title,url,id,w,h){
	layer_show(title,url,w,h);	
}
/*用户-删除*/
function member_del(obj,url){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: url,
			dataType: 'json',
			success: function(res){
				if(res == 1){
					$(obj).parents("tr").remove();
					layer.msg('已删除!',{icon:1,time:1000});
					$('#count').text(parseInt($('#count').text())-1);
				}else{
					layer.msg('删除失败，请重试!',{icon:5,time:1000});
				}
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}
</script> 
</body>


</html>